package com.training.api.repository;

import com.training.bean.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface UserRepository extends JpaRepository<User, Integer> {

    // 自定义查询方法（按用户名查找）
    @Query("SELECT data FROM User data WHERE data.phone = :phone")
    User findUserByPhone(@Param("phone") String phone);
}
